package com.example.user.filter;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.UnsupportedEncodingException;

@Configuration
public class Cb1_config {
        @Bean
        public FilterRegistrationBean heFilterRegistration() {
            FilterRegistrationBean registration = new FilterRegistrationBean(new Cb1_demo());
            registration.addUrlPatterns("/*");
            registration.setOrder(1);
            return registration;
    }

    public static void main(String[] args) throws UnsupportedEncodingException {
            String zhong = "中";
        byte[] bytes = zhong.getBytes("iso-8859-1");
        String s = new String(bytes, "iso-8859-1");
        System.out.println(s);

    }

}
